'********************************************************************
' 
'  file:  Program.vb
' 
'  (C) Copyright 2010, Diomede Corporation
'  All rights reserved
' 
'  Use, modification, and distribution is subject to   
'  the New BSD License (See accompanying file license.txt).
' 
'********************************************************************

Imports System
Imports System.Collections.Generic
Imports System.Text


Namespace Diomede.SDK.ExampleVB
    Class Program
        <STAThread()> _
        Public Shared Sub Main(ByVal args As String())
            Console.BufferWidth = 100
            Console.WindowWidth = 100
            Console.WindowHeight = 50

            Dim [exit] As Boolean = False
            While Not [exit]
                writeMenu()
                Dim key As ConsoleKeyInfo = Console.ReadKey()
                Select Case key.Key
                    Case ConsoleKey.NumPad0, ConsoleKey.D1
                        Dim acct As New AccountManagementSample()
                        acct.start()
                        Return
                    Case ConsoleKey.D2


                        Return
                    Case ConsoleKey.D3
                        Dim pms As New PurchasingManagementSample()
                        pms.Start()
                        Return
                    Case ConsoleKey.Escape
                        [exit] = True
                        Exit Select
                    Case Else
                        Exit Select
                End Select
            End While

        End Sub

        Private Shared Sub writeMenu()
            Console.Clear()
            Utils.WriteMessage("----------------------------------------------")
            Utils.WriteMessage(" Select Sample to Run VB")
            Utils.WriteMessage("----------------------------------------------")
            Utils.WriteMessage("(1) AccountManagement Sample")
            Utils.WriteMessage("(2) FileManagement Sample")
            Utils.WriteMessage("(3) PurchasingManagement Sample")
            Utils.WriteMessage("(Esc) To Exit")
            Utils.WriteMessage("")
            Utils.WriteMessage("")
            Utils.WriteMessage("----------------------------------------------")
            Console.Write("Enter Selected #: ")
        End Sub
    End Class
End Namespace